package com.kaili.basic.controller.pda.v1;

import com.kaili.basic.pojo.entity.BaseDict;
import com.kaili.basic.service.IBaseDictService;
import com.kaili.basic.version.ApiVersion;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 * 数据字典 前端控制器
 * </p>
 *
 * @author nigang
 * @since 2018-05-04
 */
@RestController("baseDictControllerP")
@ApiVersion(1)
@RequestMapping("/{api_version}")
@Api(tags = "[pda]数据字典", description = "[pda]数据字典相关API")
public class BaseDictController {
    @Autowired
    IBaseDictService baseDictService;

    @GetMapping(value = "p/dicts/{parentId}/byParentId")
    @ApiOperation(value = "查子项数据", notes = "根据id查询其子项数据")
    public List<BaseDict> getDictByParentId(@PathVariable("parentId") Integer parentId) {
        return baseDictService.getDictByParentId(parentId);
    }
}

